package com.h5ve.base.util;

import cn.hutool.extra.spring.SpringUtil;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;

/**
 * @author yong
 * @date 2022/3/18
 * @description 国际化util
 */
public class MessageUtil {

    private static MessageSource messageSource = SpringUtil.getBean("messageSource");

    public static String getText(String code, String... params) {
        return messageSource.getMessage(code, params, LocaleContextHolder.getLocale());
    }
}
